package cn.lisens.influxdb.entity;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;

import lombok.Data;

//@Measurement(name = "elec")
@Data
public class ElecUsage {

    @Column(tag = true)
    private String collectDay;
    
    @Column(tag = true)
    private String collectMonth;
    
    private String field;

    @Column
    private Double value;

    @Column(timestamp = true)
    private Instant time;
    
    public LocalDateTime getLocalDateTime() {
    	return LocalDateTime.ofInstant(time, ZoneId.systemDefault());
    }
}
